package cn.hotel;

import cn.hotel.pojo.Log;
import cn.hotel.pojo.OrderManagement;
import cn.hotel.pojo.RoomKeeper;
import cn.hotel.service.*;
import cn.hotel.utlis.Paging;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class HotelApplication {

    public static void main(String[] args) {
//        LogService service = new LogServiceImpl();
//        Paging<Log> logPaging = new Paging<>();
//        Map<String ,Object> objectMap = service.logMap(null,1,5);
//        if("1".equals(objectMap.get("flag"))){
//            logPaging.setPagingList((List<Log>) objectMap.get("data"));
//            logPaging.getPagingList().forEach(log -> {
//                System.out.println(log.getId());
//            });
//        }

//        //目标日期 月份10-1因为月份是从0开始计算
//        Calendar calendar = Calendar.getInstance();
//        calendar.set(2023, 03, 24);
//        Date calender = calendar.getTime();
////当前时间
//        Calendar calendar1 = Calendar.getInstance();
//        calendar.set(2023,03,24);
//        Date calender1 = calendar1.getTime();
////时间差值（毫秒）
//        long diff = calendar.getTimeInMillis() - calendar1.getTimeInMillis();
////获取天数 1000*60*60*24 代表一天的毫秒
//        int day = (int) (diff / (1000 * 60 * 60 * 24));
//        System.out.println(day);

//        RoomKeeper roomKeeper = new RoomKeeper();
//        roomKeeper.setRoomNumber(416);
//        roomKeeper.setHouseTypeId(1);
//        RoomKeeperService roomKeeperService = new RoomKeeperServiceImpl();
//        Map<String ,Object> objectMap = roomKeeperService.addRoomKeeper(roomKeeper);
//        if("1".equals(objectMap.get("flag"))){
//            System.out.println(objectMap.get("mag"));
//        }

        FrontEndService frontEndService = new FrontEndServiceImpl();
        OrderManagement orderManagement = new OrderManagement();
        orderManagement.setPassword("YD851888");
        orderManagement.setManageName("人");
        orderManagement.setCheckInDate("2023-03-24");
        orderManagement.setCheckOutDate("2023-03-25");
        orderManagement.setMobilePhone("18340028200");
        orderManagement.setIdentityCard("370828200006171312");
        orderManagement.setPersonNum(1);
        orderManagement.setHouseTypeId(4);
        orderManagement.setPrice("99");
        orderManagement.setRoomNumber(105);
        orderManagement.setRemark("哈哈哈");
        int ok = frontEndService.reserve(orderManagement);
        System.out.println(ok);

    }
}
